<?php

class App_View_Helper_GetWords
{
    function getWords($str, $num_words = 0)
    {
    	if ($num_words == 0) {
    		return $str;
    	}
		return implode(" ", array_slice(preg_split("/\s+/", $str), 0, $num_words)).' ...';
	}
}